package com.xy.blog.article.api;

import com.xy.blog.article.api.model.SpecialColumnDTO;
import com.xy.blog.article.api.model.SpecialColumnQuery;
import com.xy.blog.core.exception.BaseException;
import com.xy.blog.core.springmvc.controller.IBaseController;
import com.xy.blog.core.springmvc.result.page.PageReq;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @author zanhonglei
 * @version V1.0
 * @Description:
 * @date 2020/5/26
 */
@FeignClient(name = "xy-blog-article-center",contextId = "SpecialColumnService")
public interface SpecialColumnService extends IBaseController<SpecialColumnQuery, SpecialColumnDTO> {

    String BASE_PATH = "/v1/special-column";

    @Override
    @PostMapping(BASE_PATH + "/pages")
    Object pages(@RequestBody PageReq<SpecialColumnQuery> req) throws BaseException;

    @Override
    @GetMapping(BASE_PATH)
    Object getById(@RequestParam Long id) throws BaseException;

    @Override
    @PutMapping(BASE_PATH)
    Object update(@Valid @RequestBody SpecialColumnDTO req) throws BaseException;

    @Override
    @DeleteMapping(BASE_PATH)
    Object deleteById(@RequestParam Long id) throws BaseException;

    @GetMapping(BASE_PATH + "/list")
    Object list(@RequestParam String name) throws BaseException;

    @GetMapping(BASE_PATH + "/view")
    Object view(@RequestParam Long id) throws BaseException;




}
